<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('order_sn')->unique()->comment('订单号');
            $table->integer('goods_id')->comment('商品id');
            $table->decimal('price')->comment('金额');
            $table->integer('uid')->comment('用户id');
            $table->integer('sale_id')->comment('卖家id');
            $table->integer('status')->comment('1已下单，2已付款，3卖家已发货，4买家已收到');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
